<{if !$inAdmin}>
  <{assign var=leftLoop value=$xoBlocks.canvas_left}>
  <{assign var=rightLoop value=$xoBlocks.canvas_right}>
  <{assign var=topLeftLoop value=$xoBlocks.page_topleft}>
  <{assign var=topRightLoop value=$xoBlocks.page_topright}>
  <{assign var=topCenterLoop value=$xoBlocks.page_topcenter}>
  <{assign var=bottomLeftLoop value=$xoBlocks.page_bottomleft}>
  <{assign var=bottomRightLoop value=$xoBlocks.page_bottomright}>
  <{assign var=bottomCenterLoop value=$xoBlocks.page_bottomcenter}>  

  <{************** Block Logic **************}>
  <{if $xoBlocks.canvas_left && $show_leftblocks && $xoBlocks.canvas_right && $show_rightblocks}>
    <{assign var=content_grid value='6'}>
    <{assign var=content_grid_extra_classes value=''}>

    <{assign var=topcenter_grid value='6'}>
    <{assign var=topcenter_grid_extra_classes value='alpha omega'}>

    <{if $xoBlocks.page_topleft && !$xoBlocks.page_topright || !$xoBlocks.page_topleft && $xoBlocks.page_topright}>
      <{assign var=topleft_grid value='6'}>
      <{assign var=topright_grid value='6'}>
      <{assign var=topleft_grid_extra_classes value='alpha omega'}>
      <{assign var=topright_grid_extra_classes value='alpha omega'}>
    <{else}>
      <{assign var=topleft_grid value='3'}>
      <{assign var=topright_grid value='3'}>
      <{assign var=topleft_grid_extra_classes value='alpha'}>
      <{assign var=topright_grid_extra_classes value='omega'}>
    <{/if}>

    <{assign var=bottomcenter_grid value='6'}>
    <{assign var=bottomcnter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_bottomleft && !$xoBlocks.page_bottomright || !$xoBlocks.page_bottomleft && $xoBlocks.page_bottomright}>
      <{assign var=bottomleft_grid value='6'}>
      <{assign var=bottomright_grid value='6'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha omega'}>
      <{assign var=bottomright_grid_extra_classes value='alpha omega'}>
    <{else}>
      <{assign var=bottomleft_grid value='3'}>
      <{assign var=bottomright_grid value='3'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha'}>
      <{assign var=bottomright_grid_extra_classes value='omega'}>    
    <{/if}>

  <{elseif $xoBlocks.canvas_left && !$xoBlocks.canvas_right || !$xoBlocks.canvas_left && $xoBlocks.canvas_right || !$show_leftblocks && $show_rightblocks || $show_leftblocks && !$show_rightblocks}>
    <{assign var=content_grid value='9'}>

    <{assign var=topcenter_grid value='9'}>
    <{assign var=topcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_topleft && !$xoBlocks.page_topright || !$xoBlocks.page_topleft && $xoBlocks.page_topright}>
      <{assign var=topleft_grid value='9'}>
      <{assign var=topright_grid value='9'}>
      <{assign var=topleft_grid_extra_classes value='alpha omega'}>
      <{assign var=topright_grid_extra_classes value='alpha omega'}>    
    <{else}>
      <{assign var=topleft_grid value='3'}>
      <{assign var=topright_grid value='6'}>
      <{assign var=topleft_grid_extra_classes value='alpha'}>
      <{assign var=topright_grid_extra_classes value='omega'}>    
    <{/if}>

    <{assign var=bottomcenter_grid value='9'}>
    <{assign var=bottomcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_bottomleft && !$xoBlocks.page_bottomright || !$xoBlocks.page_bottomleft && $xoBlocks.page_bottomright}>
      <{assign var=bottomleft_grid value='9'}>
      <{assign var=bottomright_grid value='9'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha omega'}>
      <{assign var=bottomright_grid_extra_classes value='alpha omega'}>    
    <{else}>
      <{assign var=bottomleft_grid value='6'}>
      <{assign var=bottomright_grid value='3'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha'}>
      <{assign var=bottomright_grid_extra_classes value='omega'}>        
    <{/if}>

  <{else}>
    <{assign var=content_grid value='12'}>
    <{assign var=content_grid_extra_classes value='alpha omega'}>

    <{assign var=topcenter_grid value='12'}>
    <{assign var=topcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_topleft && !$xoBlocks.page_topright || !$xoBlocks.page_topleft && $xoBlocks.page_topright}>
      <{assign var=topleft_grid value='12'}>
      <{assign var=topright_grid value='12'}>
      <{assign var=topleft_grid_extra_classes value='alpha omega'}>
      <{assign var=topright_grid_extra_classes value='alpha omega'}>     
    <{else}>
      <{assign var=topleft_grid value='6'}>
      <{assign var=topright_grid value='6'}>
      <{assign var=topleft_grid_extra_classes value='alpha'}>
      <{assign var=topright_grid_extra_classes value='omega'}>      
    <{/if}>

    <{assign var=bottomcenter_grid value='12'}>
    <{assign var=bottomcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_bottomleft && !$xoBlocks.page_bottomright || !$xoBlocks.page_bottomleft && $xoBlocks.page_bottomright}>
      <{assign var=bottomleft_grid value='12'}>
      <{assign var=bottomright_grid value='12'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha omega'}>
      <{assign var=bottomright_grid_extra_classes value='alpha omega'}>       
    <{else}>
      <{assign var=bottomleft_grid value='6'}>
      <{assign var=bottomright_grid value='6'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha'}>
      <{assign var=bottomright_grid_extra_classes value='omega'}>        
    <{/if}>
  <{/if}>

<{else}>
  <{assign var=leftLoop value=$xoBlocks.canvas_left_admin}>
  <{assign var=rightLoop value=$xoBlocks.canvas_right_admin}>
  <{assign var=topLeftLoop value=$xoBlocks.page_topleft_admin}>
  <{assign var=topRightLoop value=$xoBlocks.page_topright_admin}>
  <{assign var=topCenterLoop value=$xoBlocks.page_topcenter_admin}>
  <{assign var=bottomLeftLoop value=$xoBlocks.page_bottomleft_admin}>
  <{assign var=bottomRightLoop value=$xoBlocks.page_bottomright_admin}>
  <{assign var=bottomCenterLoop value=$xoBlocks.page_bottomcenter_admin}>

  <{************** Admin Block Logic **************}>
  <{if $xoBlocks.canvas_left_admin && $show_leftblocks && $xoBlocks.canvas_right_admin && $show_rightblocks}>
    <{assign var=content_grid value='6'}>
    <{assign var=content_grid_extra_classes value=''}>

    <{assign var=topcenter_grid value='6'}>
    <{assign var=topcenter_grid_extra_classes value='alpha omega'}>

    <{if $xoBlocks.page_topleft_admin && !$xoBlocks.page_topright_admin || !$xoBlocks.page_topleft_admin && $xoBlocks.page_topright_admin}>
      <{assign var=topleft_grid value='6'}>
      <{assign var=topright_grid value='6'}>
      <{assign var=topleft_grid_extra_classes value='alpha omega'}>
      <{assign var=topright_grid_extra_classes value='alpha omega'}>
    <{else}>
      <{assign var=topleft_grid value='3'}>
      <{assign var=topright_grid value='3'}>
      <{assign var=topleft_grid_extra_classes value='alpha'}>
      <{assign var=topright_grid_extra_classes value='omega'}>
    <{/if}>

    <{assign var=bottomcenter_grid value='6'}>
    <{assign var=bottomcnter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_bottomleft_admin && !$xoBlocks.page_bottomright_admin || !$xoBlocks.page_bottomleft_admin && $xoBlocks.page_bottomright_admin}>
      <{assign var=bottomleft_grid value='6'}>
      <{assign var=bottomright_grid value='6'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha omega'}>
      <{assign var=bottomright_grid_extra_classes value='alpha omega'}>
    <{else}>
      <{assign var=bottomleft_grid value='3'}>
      <{assign var=bottomright_grid value='3'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha'}>
      <{assign var=bottomright_grid_extra_classes value='omega'}>    
    <{/if}>

  <{elseif $xoBlocks.canvas_left_admin && !$xoBlocks.canvas_right_admin || !$xoBlocks.canvas_left_admin && $xoBlocks.canvas_right_admin || !$show_leftblocks && $show_rightblocks || $show_leftblocks && !$show_rightblocks}>
    <{assign var=content_grid value='9'}>

    <{assign var=topcenter_grid value='9'}>
    <{assign var=topcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_topleft_admin && !$xoBlocks.page_topright_admin || !$xoBlocks.page_topleft_admin && $xoBlocks.page_topright_admin}>
      <{assign var=topleft_grid value='9'}>
      <{assign var=topright_grid value='9'}>
      <{assign var=topleft_grid_extra_classes value='alpha omega'}>
      <{assign var=topright_grid_extra_classes value='alpha omega'}>    
    <{else}>
      <{assign var=topleft_grid value='3'}>
      <{assign var=topright_grid value='6'}>
      <{assign var=topleft_grid_extra_classes value='alpha'}>
      <{assign var=topright_grid_extra_classes value='omega'}>    
    <{/if}>

    <{assign var=bottomcenter_grid value='9'}>
    <{assign var=bottomcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_bottomleft_admin && !$xoBlocks.page_bottomright_admin || !$xoBlocks.page_bottomleft_admin && $xoBlocks.page_bottomright_admin}>
      <{assign var=bottomleft_grid value='9'}>
      <{assign var=bottomright_grid value='9'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha omega'}>
      <{assign var=bottomright_grid_extra_classes value='alpha omega'}>    
    <{else}>
      <{assign var=bottomleft_grid value='6'}>
      <{assign var=bottomright_grid value='3'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha'}>
      <{assign var=bottomright_grid_extra_classes value='omega'}>        
    <{/if}>

  <{else}>
    <{assign var=content_grid value='12'}>
    <{assign var=content_grid_extra_classes value='alpha omega'}>

    <{assign var=topcenter_grid value='12'}>
    <{assign var=topcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_topleft_admin && !$xoBlocks.page_topright_admin || !$xoBlocks.page_topleft_admin && $xoBlocks.page_topright_admin}>
      <{assign var=topleft_grid value='12'}>
      <{assign var=topright_grid value='12'}>
      <{assign var=topleft_grid_extra_classes value='alpha omega'}>
      <{assign var=topright_grid_extra_classes value='alpha omega'}>     
    <{else}>
      <{assign var=topleft_grid value='6'}>
      <{assign var=topright_grid value='6'}>
      <{assign var=topleft_grid_extra_classes value='alpha'}>
      <{assign var=topright_grid_extra_classes value='omega'}>      
    <{/if}>

    <{assign var=bottomcenter_grid value='12'}>
    <{assign var=bottomcenter_grid_extra_classes value='alpha omega'}>
    <{if $xoBlocks.page_bottomleft_admin && !$xoBlocks.page_bottomright_admin || !$xoBlocks.page_bottomleft_admin && $xoBlocks.page_bottomright_admin}>
      <{assign var=bottomleft_grid value='12'}>
      <{assign var=bottomright_grid value='12'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha omega'}>
      <{assign var=bottomright_grid_extra_classes value='alpha omega'}>       
    <{else}>
      <{assign var=bottomleft_grid value='6'}>
      <{assign var=bottomright_grid value='6'}>
      <{assign var=bottomleft_grid_extra_classes value='alpha'}>
      <{assign var=bottomright_grid_extra_classes value='omega'}>        
    <{/if}>
  <{/if}>
<{/if}>